package com.jinke.api.modules.third.shippo.model.response;

import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

@Data
@Accessors(chain = true)
public class ShippoEstimateVO {

    private String object_id;
    private String object_created;
    private String object_updated;
    private String object_owner;
    private boolean test;
    private String metadata;
    private List<Message> messages;
    private Object extra;
    private Object order;
    private List<String> carrier_accounts;
    private Address address_from;
    private Address address_to;
    private List<Parcel> parcels;
    private List<Rate> rates;
    private String status;
    private String shipment_date;
    private Address address_return;
    private Object alternate_address_to;
    private Object customs_declaration;

    @Data
    public static class Rate {

        private String object_id;
        private String object_created;
        private String object_owner;
        private String shipment;
        private BigDecimal amount;
        private String currency;
        private BigDecimal amount_local;
        private String currency_local;
        private List<String> attributes;
        private String provider;
        private String provider_image_75;
        private String provider_image_200;
        private String arrives_by;
        private String duration_terms;
        private List<String> messages;
        private String carrier_account;
        private String zone;
        private boolean test;
        private Servicelevel servicelevel;
        private int estimated_days;
        private Double included_insurance_price;
    }
        @Data
        public static class Servicelevel {
            private String name;
            private String token;
            private String terms;
            private String extended_token;
            private String display_name;
            private Servicelevel parent_servicelevel;
        }

    @Data
    public static class Message {
        private String source;
        private String code;
        private String text;
    }

    @Data
    public static class Address {
        private String name;
        private String street1;
        private String street2;
        private String street3;
        private String city;
        private String state;
        private String zip;
        private String country;
        private String street_no;
        private String phone;
        private String email;
        private String company;
        private Boolean is_residential;
        private boolean test;
        private String object_id;
        private boolean is_complete;
        private Object validation_results;
    }

    @Data
    public static class Parcel {
        private String object_owner;
        private String object_state;
        private String mass_unit;
        private Object template;
        private Object extra;
        private String metadata;
        private boolean test;
        private String object_id;
        private String object_created;
        private String object_updated;
        private String length;
        private String width;
        private String height;
        private String distance_unit;
        private String weight;
        private List<Object> line_items;
    }
}
